import axios from '../libs/http';

//前端请求函数封装
function getPhones<T>(): Promise<T> {
  //固定写法get<T, T>
  return axios.get<T, T>('/phones')
    .then((data: T) => {
      return data;
    })
    .catch((err: any) => {
      throw new Error('Request failed' + err);
    });
}

export { getPhones }